package com.game;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Point;



public class Ball {
	protected Bitmap img;
	protected Point position;
	protected Point heading;
	
	protected BackgroundMirror mBackgroundMirror;

	private int radius;
	
	public Ball(Context context, int imgRef, Point pos, BackgroundMirror bgmirror)
	{
		img = BitmapFactory.decodeResource(context.getResources(), imgRef);
		setPosition(pos);
		radius = img.getWidth()/2;
		mBackgroundMirror = bgmirror;
	}	
	
	
	public void onDraw(Canvas canvas)
	{
		canvas.drawBitmap(getImg(),getPosition().x, getPosition().y, null);	

	}
	
	public void Update()
	{
		
	}

	

	public void setImg(Bitmap img) {
		this.img = img;
	}

	public Bitmap getImg() {
		return img;
	}

	public void setPosition(Point position) {
		this.position = position;
	}

	public Point getPosition() {
		return position;
	}

	public void setHeading(Point heading) {
		this.heading = heading;
	}

	public Point getHeading() {
		return heading;
	}


	
	public int getRadius() {
		return radius;
	}
	
	public int getCenterX()	{return position.x + radius;	}	
	public int getCenterY()	{return position.y + radius;	}
	
	public int getLeft() 	{return position.x;}
	public int getRight() 	{return position.x + img.getWidth();}
	public int getTop()		{return position.y;}
	public int getBottom() 	{return position.y + img.getHeight();}
	
	public void setLeft(int limit) 	{ position.x = limit;}
	public void setRight(int limit) 	{position.x= limit - img.getWidth();}
	public void setTop(int limit)    {position.y = limit;}
	public void setBottom(int limit) {position.y = limit- img.getHeight();}
	
}
